package com.han.hotelplat.cms.controller.datacenter.total;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.han.hotelplat.comm.ResponseWrapTo;
import com.han.hotelplat.service.datacenter.total.AllDataTotalService;

/**
 * 数据概览
	 ***************************************************************
	 * <p>
	 * @CLASS				:	DataTotalControlller
	 * @DESCRIPTION	:	
	 * @AUTHOR				:	han1088
	 * @VERSION			:	v1.0
	 * @DATE					:	2018年10月22日 下午2:34:51            
	 * </p>
	 * 
	 * <p>
	 * @MODIFY	LOG	:		
	 * @AUTHOR				:	han1088
	 * @VERSION			:	v1.0
	 * @MODIFY DATE	:	
	 * </p>    
	 ****************************************************************
 */

@Controller
@RequestMapping("/cms/datacenter/alldatatotal")
public class DataTotalControlller {
	@Autowired
	private AllDataTotalService allDataTotalService;
	
	/**
	 * 获取当日概览数据
		 * @description	
		 * @author  han1088
		 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "getAllTotalData", produces = "application/json;charset=UTF-8", method = { RequestMethod.GET, RequestMethod.POST })
	public String getAllTotalData(){
		Map<String, Object> data = allDataTotalService.getAllDataTotal();
		return new ResponseWrapTo(0, "数据获取成功", data).toJson();
	}
	
	/**
	 * 获取7日数据
		 * @description	
		 * @author  han1088
		 * @param type 0帮工，1酒店，2房量，3支出
		 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "getSevenDayDataTotal", produces = "application/json;charset=UTF-8", method = { RequestMethod.GET, RequestMethod.POST })
	public String getSevenDayDataTotal(Integer type){
		List<Map<String, Object>>  data = allDataTotalService.getSevenDayDataTotal(type);
		return new ResponseWrapTo(0, "数据获取成功", data).toJson();
	}
}
